package com.wanglei.rdd.action

import org.apache.spark.{SparkConf, SparkContext}

object Spark06_foreach {

  def main(args: Array[String]): Unit = {

    //
    val conf = new SparkConf().setMaster("local[2]").setAppName("map")
    val sc = new SparkContext(conf)


    val rdd = sc.makeRDD(List(
      1, 2, 3, 4
    ))

    // 直接foreach其实是在executor中打印的
    rdd.foreach(println)

    sc.stop()

  }

}


